package cn.sxt.yxl.common.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.alibaba.fastjson.JSONObject;

import cn.sxt.yxl.common.util.ConstatFinalUtil;
import cn.sxt.yxl.question.service.IQuestionSpiderService;

/**
 * 测试多线程,只能使用main方法
 * @author wangshSxt
 *
 */
public class MyThreadTest2
{
	public static void main(String[] args)
	{
		ApplicationContext ac = new ClassPathXmlApplicationContext("classpath*:spring/applicationContext_*.xml");
		ConstatFinalUtil.LOGGER.info("---init--ac:{}",ac);
		/* 初始化Spring容器 */
		IQuestionSpiderService questionSpiderService = (IQuestionSpiderService)ac.getBean("questionSpiderService");
		/* 调用采集的方法 */
		String url = ""; 
		JSONObject resultJSON = questionSpiderService.saveBatchItemsService(url);
		ConstatFinalUtil.LOGGER.info("----结束----{}",resultJSON);
	}
}
